package kafka_model_apps

class Apps {

    var title = ""
    var volume = ""
    var downloads = ""
    var follow = ""
    var comment = ""
    var tags = ""
    var rank_num = ""
    var rom = ""
    var developer = ""
    var rank_num_users = ""
    var update_time = ""

    def this(data: Map[String, Any]) {
        this()
        title = getData(data.get("title").toString)
        volume = getData(data.get("volume").toString)
        downloads = getData(data.get("downloads").toString)
        follow = getData(data.get("follow").toString)
        comment = getData(data.get("comment").toString)
        tags = getData(data.get("tags").toString)
        rank_num = getData(data.get("rank_num").toString)
        rom = getData(data.get("rom").toString)
        developer = getData(data.get("developer").toString)
        rank_num_users = getData(data.get("rank_num_users").toString)
        update_time = getData(data.get("update_time").toString)
    }

    def getData(s: String): String = {
        val rs = s.drop(5)
        rs.dropRight(1)
    }
}
